代码简洁之道

1、重置vue中data的数据,不用一个个地重新写一遍

  1. Object.assign(this.$data, this.$options.data())/*重置vue中的data*/

这里 this.$options.data()就是初始化的那个data数据

2、数组判空,为null或者undefined的时候为0

  1. _.size(this.cellLines) > 2

3、判空,避免多级判断,或者为null的情况,导致第三个参数不生效

  1. _.get(obj, 'a.b.c') || 0